FROM node:lts-alpine AS build
WORKDIR /build
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
    && apk update \
    && apk upgrade \
    && apk add  git \
                python3 \
                nginx \
    && git clone https://gitee.com/jackzyy/demo531.git \
    && cd ./demo531 \
    && npm i pnpm -g \
    && export SASS_BINARY_SITE="https://npm.taobao.org/mirrors/node-sass" \
    && pnpm i \
    && pnpm build

FROM nginx:alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone
COPY --from=build /build/demo531/dist/ /usr/share/nginx/html/
COPY --from=build /build/demo531/nginx.conf /etc/nginx/nginx.conf